<template>
	<view>
		<van-button type="default" @click="pdfdownload">download</van-button>
	</view>
</template>

<script>
	export default {
		data() {
			return {

			}
		},
		methods: {
			pdfdownload() {
				wx.downloadFile({
					url: 'http://192.168.0.238:29002/苏州园林.pdf',
					success: function(res) {
						const filePath = res.tempFilePath
						console.log('下载文档成功')
						wx.openDocument({
							filePath: filePath,
							fileType: "pdf",
							showMenu: true,
							success: function(res) {
								console.log('打开文档成功')
							},
							fail: function() {
								console.log('失败')
							},
							complete: function() {
								console.log('完成')
							}
						})
					}
				});
			}
		}
	}
</script>

<style>

</style>